<template>
  <el-dialog v-model="visible" title="任务详细" width="600" center destroy-on-close >
    <el-descriptions column="1" border v-model="taskDetail">
      <el-descriptions-item label="任务编号">{{taskDetail.id }}</el-descriptions-item>
      <el-descriptions-item label="任务分组">{{taskDetail.jobGroup }}</el-descriptions-item>
      <el-descriptions-item label="任务名称">{{taskDetail.jobName }}</el-descriptions-item>
      <el-descriptions-item label="创建时间">{{taskDetail.createTime }}</el-descriptions-item>
      <el-descriptions-item label="cron表达式">{{taskDetail.cronExpression }}</el-descriptions-item>
      <el-descriptions-item label="下次执行时间">{{taskDetail.nextValidTime }}</el-descriptions-item>
      <el-descriptions-item label="任务状态">{{taskDetail.status == 1?'运行':'暂停' }}</el-descriptions-item>
      <el-descriptions-item label="是否并发">{{taskDetail.concurrent == 1?'允许':'禁止' }}</el-descriptions-item>
      <el-descriptions-item label="执行策略">
        <template #default="row">
          <div v-if="taskDetail.misfirePolicy==0">默认</div>
          <div v-if="taskDetail.misfirePolicy==1">立即执行</div>
          <div v-if="taskDetail.misfirePolicy==2">执行一次</div>
          <div v-if="taskDetail.misfirePolicy==3">放弃执行</div>
        </template>
      </el-descriptions-item>
    </el-descriptions>
    <template #footer>
      <el-button @click="visible=false" >取 消</el-button>
    </template>
  </el-dialog>
</template>

<script>
export default {
  name: "taskDetail",
  data() {
    return {
      visible: true,
      taskDetail:{}
    }
  },
  methods: {
    //表单注入数据
    async setData(id) {
      if (id) {
        let res = await this.$API.monitor.timing.detail.get(id)
        this.taskDetail = res.data
      }
    }
  }
}
</script>

<style scoped>

</style>
